package com.xuxin.nantai.presenter;

import com.xuxin.nantai.bean.BaseBean;
import com.xuxin.nantai.bean.SelectDetailBean;
import com.xuxin.nantai.contract.SelectDetailContract;
import com.xuxin.nantai.model.SelectDetailModel;

/**
 * Created by xu_xin
 * Created on 2020.06.12 0012
 */
public class SelectDetailPresenter implements SelectDetailContract.Presenter {
    private SelectDetailModel model;
    private SelectDetailContract.View view;

    public SelectDetailPresenter(SelectDetailContract.View view) {
        model = new SelectDetailModel();
        this.view = view;
    }

    @Override
    public void getSelectDetail(String ID) {
        if (null != model) {
            model.getSelectDetail(this, ID);
        }
    }

    @Override
    public void delete(String UserName, String Guid) {
        if (null != model) {
            model.delete(this, UserName, Guid);
        }
    }

    @Override
    public void onSuccess(SelectDetailBean selectDetailBean) {
        if (null != view) {
            view.onSuccess(selectDetailBean);
        }
    }

    @Override
    public void onSuccess(BaseBean baseBean) {
        if (null != view) {
            view.onSuccess(baseBean);
        }
    }

    /**
     * 以下内容复用
     */
    @Override
    public void onError(BaseBean baseBean) {
        if (null != view) {
            view.onError(baseBean);
        }
    }

    @Override
    public void onComplete() {
        if (null != view) {
            view.onComplete();
        }
    }
}